
Ext.onReady(function(){
						var hiddenEid = new Ext.form.Hidden({
										name : "nId"
									});
						var txtName = new Ext.form.TextField({
										fieldLabel : "新闻标题",
										name : "nTitle",
										allowBlank : false
									});
						var nSummary = new Ext.form.TextArea({
										fieldLabel : "新闻摘要",
										name : "nSummary",
										allowBlank : false,
										width : 330
									});
										var proxy = new Ext.data.HttpProxy({
										url : "dept.do?method=queryDepts"	//获取新闻对应栏目的action
									});
							var reader = new Ext.data.JsonReader({}, [{
												name : "rec_cId",
												type : "int",
												mapping : "cId"
											},
											{
												name : "rec_cTitle",
												type : "string",
												mapping : "cTitle"
											}]);
							var store2 = new Ext.data.Store({
								proxy : proxy,
								reader : reader,
								autoLoad : true,                //自动加载数据
								listeners : {
									load : function() {
										categorylist.setValue("category1");//cmbDept.setValue(record.get("rec_cId"));//为复选框选定原来的值
									}
								}
							});
							var categorylist = new Ext.form.ComboBox({
										store : store2,
										fieldLabel : "所在栏目",
										displayField : "rec_cTitle",		//显示值是栏目Title
										valueField : "rec_cId",				//实际值为栏目标识符
										mode : "remote",
										triggerAction : "all",
										allowBlank : false,
										emptyText : "请选着新闻所在栏目",
										allowBlank : false,
										editable : false,
										name : "cId",
										hiddenName : "cId" // 请注意，设置该选项才能将实际值传送到服务器  employeeVo.did
									});
									
var form = new Ext.form.FormPanel({
			title:"新闻修改表单",
			frame : true,
			layout:'form',
			items : [	hiddenEid,
						txtName, 
						categorylist,
						nSummary, {
                                      	  name: 'body',
                                        fieldLabel: '正文',
                                        height: 430,
                                        xtype:'fckeditor',
                                        anchor:'100%',
                                        id:'body'
                                    }],
			url : "#",
			baseParams : {
				method : "edit"
			},
			method : "post",
			buttons : [{
						text : "修改",
						handler : function() {
							var json = {
								success : function(f, action) {
									Ext.Msg.alert("成功", action.result.msg);
									store.reload();
									win.close();
								},

								failure : function() {
									Ext.Msg.alert("失败", "对不起，操作失败，请检查数据是否完整！");
								}
							};
							form.getForm().submit(json);
						}
					}, {
						text : "关闭",
						handler : function() {
							win.close();
						}
					}]
		});
var win = new Ext.Window({
			title : "修改新闻",
			plain:true,
			id : "edit",
			width : 500,
			modal : true,
			height:500,
			//autoHeight : true,
			items : [form]
		});
win.show("win");
})